import { pickerOptionsStatic } from '@/utils/config'
import { translate } from '@/utils/i18n'
export const formItems = [
  {
    filed: 'name',
    type: 'input',
    label: translate('hdname')
  },
  {
    filed: 'businessType',
    type: 'select',
    label: translate('goodsType'),
    clearable: true,
    options: [
      { value: '', label: translate('allType') },
      { value: '04', label: translate('combo') },
      { value: '07', label: translate('course') },
      { value: '19', label: translate('specialCard') }
    ]
  },
  {
    filed: 'status',
    type: 'select',
    label: translate('status'),
    clearable: true,
    options: [
      { value: '', label: translate('all') },
      { value: '0', label: translate('nostarted') },
      { value: '1', label: translate('underway') },
      { value: '2', label: translate('over') }
    ]
  },
  {
    filed: 'venueId',
    type: 'select',
    label: translate('applyVenue'),
    clearable: true,
    options: []
  }
]
export const queryFormConfig = {
  formItems,
  online: true
}

export const rules = {
  businessType: [{ required: true, message: translate('qxz'), trigger: 'change' }],
  businessId: [{ required: true, message: translate('qxz'), trigger: 'change' }],
  venueId: [{ required: true, message: translate('qxz'), trigger: 'change' }],
  limitCount: [{ required: true, message: translate('qxz'), trigger: 'change' }],
  personLimit: [{ required: true, message: translate('qxz'), trigger: 'change' }],
  virtual: [{ required: true, message: translate('qxz'), trigger: 'change' }],

  selTime: [{ required: true, message: translate('qxz'), trigger: 'change' }],

  name: [{ required: true, message: translate('qsr'), trigger: 'blur' }],
  maxCount: [{ required: true, message: translate('qsr'), trigger: 'blur' }],
  personLimitCount: [{ required: true, message: translate('qsr'), trigger: 'blur' }]
}

export const activityPropList = [
  { label: translate('memberInfo'), prop: 'memberInfo', minWidth: 200 },
  { label: translate('hdGoods'), prop: 'businessName', minWidth: 100 },
  { label: translate('salesPrive'), prop: 'secOldPrice', minWidth: 80 },
  { label: translate('seckillPrice'), prop: 'discountPrice', minWidth: 90 },
  { label: translate('dealMe'), prop: 'payMethodName', minWidth: 80 },
  { label: translate('dealChannel'), prop: 'channelTypeName', minWidth: 80 },
  { label: translate('createTime'), prop: 'createTime', minWidth: 160 },
  { label: translate('status'), prop: 'payStatusName', minWidth: 100 }
]
export const orderFormItems = [
  {
    filed: 'orderId',
    type: 'input',
    label: translate('orderId')
  },
  {
    filed: 'memberInfo',
    type: 'input',
    placeholder: translate('member'),
    label: translate('memberInfo')
  },
  {
    filed: 'selTime',
    type: 'daterange',
    label: translate('createTime'),
    pickerOptions: pickerOptionsStatic
  },
  {
    filed: 'payStatus',
    type: 'select',
    label: translate('orderStatus'),
    clearable: true,
    labelCode: 'name',
    options: []
  },
  {
    filed: 'creator',
    type: 'input',
    label: translate('operator')
  }
]
export const orderFormConfig = {
  formItems: orderFormItems,
  online: true
}

// 订阅
export const subscripPropList = [
  { label: translate('memberInfo'), prop: 'memberInfo', minWidth: 140 },
  { label: translate('hdname'), prop: 'secName', minWidth: 130 },
  { label: translate('goodsName'), prop: 'businessName', minWidth: 120 },
  { label: translate('joinFlag'), prop: 'isSuccess', minWidth: 150 },
  { label: translate('subscripteTime'), prop: 'createTime', minWidth: 180 }
]
export const subscripFormItems = [
  {
    filed: 'memberInfo',
    type: 'input',
    placeholder: translate('member'),
    label: translate('memberInfo')
  },
  {
    filed: 'name',
    type: 'input',
    label: translate('hdname')
  },
  {
    filed: 'selTime',
    type: 'datetimerange',
    label: translate('subscripteTime'),
    pickerOptions: pickerOptionsStatic
  },
  {
    filed: 'status',
    type: 'select',
    label: translate('joinSta'),
    clearable: true,
    options: [
      { value: '0', label: translate('joinScs') },
      { value: '1', label: translate('joinErr') }
    ]
  }
]
export const subscripFormConfig = {
  formItems: subscripFormItems,
  online: true
}

